/*
 * @(#)ServletContextHolder.java $version 2010. 8. 11
 *
 * Copyright 2007-2010 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.nhncorp.usf.core.servlet;

import javax.servlet.ServletContext;

import com.nhncorp.usf.core.jmx.WebModuleMBean;

/**
 * {@link ServletContext} 접근을 위하 Helper.
 * {@link ConfigurationLoaderListener} 에 의해 초기화된다.
 *
 * @author Web Platform Development Team.
 * @see ConfigurationLoaderListener
 */
public class ServletContextHolder {
	/**
	 * {@link ServletContext} 객체.
	 */
	private static ServletContext servletContext;
	private static String contextRealPath;
	private static WebModuleMBean webModule;

	/**
	 * {@link ServletContext} 설정.
	 * 
	 * @param servletContext ServletContext
	 * 
	 */
	public static void set(ServletContext servletContext) {
		ServletContextHolder.servletContext = servletContext;
	}

	/**
	 * {@link ServletContext} 반환.
	 * 
	 * @return ServletContext
	 */
	public static ServletContext get() {
		return servletContext;
	}

	/**
	 * Gets the context real path.
	 * 
	 * @return the context real path
	 */
	public static String getContextRealPath() {
		return contextRealPath;
	}

	/**
	 * Sets the context real path.
	 * 
	 * @param contextPath the new context real path
	 */
	public static void setContextRealPath(String contextPath) {
		contextRealPath = contextPath;
	}

	/**
	 * Gets the web module.
	 * 
	 * @return the web module
	 */
	public static WebModuleMBean getWebModule() {
		return webModule;
	}

	/**
	 * Sets the web module.
	 * 
	 * @param webappModule the new web module
	 */
	public static void setWebModule(WebModuleMBean webappModule) {
		webModule = webappModule;
	}
}
